package ch.janotta.slawo.da.modifier;

import ch.janotta.slawo.da.Ability;
import ch.janotta.slawo.da.Entity;

public class AbilityIncreaseModifier implements Modifier {
  private Ability ability;
  private int valueIncrement;

  public AbilityIncreaseModifier(Ability ability, int valueIncrement) {
    this.ability = ability;
    this.valueIncrement = valueIncrement;
  }

  @Override
  public void apply(Entity entity) {
    int oldValue = entity.getAbilityValue(ability);
    entity.setAbilityValue(ability, oldValue + valueIncrement);
  }
}
